// $codepro.audit.disable
package edu.gatech.oad.cyberdoc.view;
import javax.swing.JPanel;
import java.awt.CardLayout;
import java.awt.BorderLayout;
import javax.swing.JLabel;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Panel;
import javax.swing.JLayeredPane;
import javax.swing.JTextPane;

import org.json.JSONObject;

import edu.gatech.oad.cyberdoc.presenter.Presenter;


public class PatientInfoPanel extends ApplicationPanel {

	/**
	 * Create the panel.
	 */
	public PatientInfoPanel() {
		setLayout(null);
		final JPanel cards = new JPanel();
		
		JLabel lblPatientInfo = new JLabel("Welcome Patient");
		lblPatientInfo.setBounds(34, 27, 86, 26);
		add(lblPatientInfo);
		
		//=========JButtons===========
		JButton btnRequestAppointment = new JButton("Request Appointment");
		btnRequestAppointment.setBounds(10, 144, 161, 66);
		btnRequestAppointment.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e){
				final CardLayout layout = (CardLayout) cards.getLayout();
				layout.show(cards, "REQUEST");
			}
		});
		add(btnRequestAppointment);
		
		JButton btnNewButton = new JButton("View Treatment Records");
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				final CardLayout layout = (CardLayout) cards.getLayout();
				layout.show(cards, "TREATMENT");	
			}
		});
		btnNewButton.setBounds(10, 233, 161, 66);
		add(btnNewButton);
		
		JButton btnViewYourInformation = new JButton("View Your Information");
		btnViewYourInformation.setBounds(10, 323, 161, 66);
		btnViewYourInformation.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e){
				final CardLayout layout = (CardLayout) cards.getLayout();
				layout.show(cards, "INFO");
			}
		});
		add(btnViewYourInformation);
		
		//=========Inset Cards Panel=========
		
		cards.setBounds(210, 20, 585, 390);
		add(cards);
		
		JPanel blankPatient = new JPanel();
		ApplicationPanel card1 = new AppointmentGroupsPanel();
		ApplicationPanel card2 = new TreatmentRecordPatientPanel();
		ApplicationPanel card3 = new InfoPanel();

		
		//Create the panel that contains the "cards".
		cards.setLayout(new CardLayout());
		
		//add individual "card" panels
		//card1 is request appointment
		//JLabel card1title = new JLabel("Request Appointment");
		//card1.add(card1title);
		
		//card2 is view treatment records
		//JLabel card2title = new JLabel("Treatment Records");
		//card2.add(card2title);
		
		//card3 is view personal information
		//JLabel card3title = new JLabel("Personal Information");
		//card3.add(card3title);
		
		//add the individual cards to the card holder panel
		cards.add(blankPatient, "BLANK");
		cards.add(card1, "REQUEST");
		cards.add(card2, "TREATMENT");
		cards.add(card3, "INFO");
		
		JButton btnLogout = new JButton("Logout");
		btnLogout.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				Presenter.getInstance().logout();
			}
		});
		btnLogout.setBounds(10, 401, 117, 29);
		add(btnLogout);
		

	}

	@Override
	public void show(JSONObject response) {
		// TODO Auto-generated method stub
		
	}
}
